import axios from "@/utils/http";
enum Api {
    permission = "/v1/room",
    close = "/v1/room/close",
}

export interface LiveSetting {
    uuid:string;
    roomName: string;
    roomPhoto: string;
    roomInformation: string;
    roomTags: string;
    roomAddress: string;
    roomStatus: number;
    status: number;
    roomUuids?: string[];
    roomPersons?:number;
    roomMessagesGroupsId:number
    userUuid:string
}

export interface ListParmas {
    page?: number;
    pageSize?: number;
    keyword: string;
}

export interface RespRoomList {
    list: LiveSetting[];
    total: number;
}

// 房间列表
export const  List = (params: ListParmas) => {
    return axios.get<RespRoomList>(Api.permission,params);
  };

// 房间详情
export const  details = (uuid: string) => {
    return axios.get<LiveSetting>(Api.permission + "/" + uuid);
  };

// 更新房间
export const  Update = (params: LiveSetting) => {
    return axios.put(Api.permission, params);
  };

// 删除房间
export const  Delete = (uuid:string) => {
    return axios.delete(Api.permission+ "/" + uuid);
  };

// 创建房间
export const  Create = (params: LiveSetting) => {
    return axios.post(Api.permission, params);
  };

  // 关闭房间
export const  close = (params: LiveSetting) => {
    return axios.post(Api.close, params);
  };